package com.beamfield.dao.device;

import com.beamfield.model.DeviceInbound;
import com.beamfield.model.DeviceInboundExample;
import com.beamfield.modelVo.DeviceInboundVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface DeviceInboundMapper {
    int countByExample(DeviceInboundExample example);

    int deleteByExample(DeviceInboundExample example);

    int deleteByPrimaryKey(Long id);

    int insert(DeviceInbound record);

    int insertSelective(DeviceInbound record);

    List<DeviceInbound> selectByExample(DeviceInboundExample example);

    DeviceInbound selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") DeviceInbound record, @Param("example") DeviceInboundExample example);

    int updateByExample(@Param("record") DeviceInbound record, @Param("example") DeviceInboundExample example);

    int updateByPrimaryKeySelective(DeviceInbound record);

    int updateByPrimaryKey(DeviceInbound record);

    List<DeviceInboundVo> selectByNameAndtype(@Param("beam_id") long beamId, @Param("name") String plan_name, @Param("type") Integer type, @Param("offset") String offset, @Param("limit") String limit, @Param("use_unit") String use_unit, @Param("devicename") String devicename);

    int selectInboundNums(@Param("beam_id")long beamid,@Param("type") int type,@Param("deviceSource")String deviceSource);

    List<DeviceInbound> selectByUseUnit(@Param("beam_id") long beamId, @Param("use_unit") String s, @Param("offset") String offset, @Param("limit") String limit,  @Param("manager_num") String manager_num,@Param("device_name")  String device_name);

    int countByUseUnit(@Param("beam_id") long beamId, @Param("use_unit") String s, @Param("manager_num") String manager_num,@Param("device_name")  String device_name);

    int countByNameAndtype(@Param("beam_id") long beamId, @Param("name") String plan_name, @Param("type") Integer type, @Param("use_unit") String use_unit,@Param("devicename") String devicename);

    List<DeviceInboundVo> selectGroupByName(@Param("query") String query, @Param("beamId") Long beamId, @Param("type") Integer type);

    List<DeviceInbound> selectByNameOrNum(@Param("offset")Integer offset,@Param("limit")Integer limit,@Param("query") String query, @Param("beamId") Long beamId);

    int countByNameOrNum(@Param("query") String query, @Param("beamId") Long beamId);

    List<DeviceInbound> selectWithGPS(@Param("offset")Integer offset,@Param("limit")Integer limit,@Param("beamId") Long beamId);

    int countWithGPS(@Param("beamId") Long beamId);

    List<DeviceInbound> selectNoOut(@Param("beamId") Long beamId);

    List<DeviceInbound> selectByDemandId(@Param("demandId") Long demandId, @Param("beamId") Long beamId);
}